\newpage
\section{Raspberry Pi Quickstart}
\label{quickstart}
This quickstart guide explains how to install the software needed to get the Raspberry Pi up and running with the Development HAT and ICCFPGA module.


\begin{enumerate}
 \item Make sure the jumpers J9, J7 and J8 on the development board are set to `PI` according to \ref{jumpers}.
 \item Prepare an SD-card with Raspbian
 \item Before booting, create the file `ssh` in the `/boot/` partition to enable ssh-access.
 \item Boot Raspberry Pi and log in via SSH with username `pi` and password `raspberry`
 \item Change the default password \\
 
\begin{lstlisting}[language=bash]
passwd
\end{lstlisting}
 
 \item Open the `raspi-config` file and enable the serial interface (\textbf{Do not} enable shell access via serial).\\
        Reboot afterwards.
 
 \item Install `git` \\
\begin{lstlisting}[language=bash]
sudo apt update && sudo apt install git
\end{lstlisting}
 \item Clone the `iccfpga-utils` repository \\

\begin{lstlisting}[language=bash]
cd ~
git clone --recursive https://gitlab.com/iccfpga-rv/iccfpga-utils
\end{lstlisting}

\item Enter the `iccfpga` directory and start the installer script \\

\begin{lstlisting}[language=bash]
cd iccfpga-utils
./install_raspberry.sh
\end{lstlisting}

The script will clone, compile and install all submodules

\item The Raspberry Pi will be rebooted in the previous step. After reboot install the core-file permanently or temporarily.

\begin{lstlisting}[language=bash]
cd iccfpga-utils

# downloads the core- and firmware-files from the latest 
# commit in the repository
./download_bin.sh

sudo ./flash_core.sh    # non-volatile programming to QSPI-flash
--- OR ---
sudo ./upload_core.sh   # volatile uploading to the FPGA

\end{lstlisting}

The flashing is a bit special, because it needs a power-cycle to load the core-file from QSPI flash. In the second variant, the core gets startet instantly after the upload.

\item Start serial terminal\\
\begin{lstlisting}[language=bash]
cd ~/iccfpga-utils
./start_serial.sh
\end{lstlisting}

\item Copy \& Paste following into the serial terminal:
    
\begin{lstlisting}[language=json]
{"command":"version"}
\end{lstlisting}

The response should look like:

\begin{lstlisting}[language=json]
{"version":"0.07rv","command":"version","duration":0,"code":200}
\end{lstlisting}


\end{enumerate}

There are three LEDs on the FPGA module. The first is a power-LED which always is lit when the board is powered. The second LED (between FPGA and mini PCIe connector) indicates if a core file was successfully loaded into the FPGA. The third LED at the top of the module is a user-LED  which is enabled in software by the firmware running on the soft-cpu in the FPGA (indicating that the firmware was started successfully).


 
 
